import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import 'package:pinball_ui/pinball_ui.dart';

import '../../gen/assets.gen.dart';
import 'cubit/assets_manager_cubit.dart';



class PinBall extends StatelessWidget {
  const PinBall({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final headline1 = Theme.of(context).textTheme.headlineSmall;
    return Scaffold(
        appBar: AppBar(
          title: Text("球球"),
        ),
        body: Container(
            decoration: const CrtBackground(),
            child: Center(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 20),
                    child: Assets.ioPinball.image(),
                  ),
                  const SizedBox(height: 40),
                  AnimatedEllipsisText(
                    'Loading',
                    style: headline1,
                  ),
                  const SizedBox(height: 40),
                  // FractionallySizedBox(
                  //   widthFactor: 0.8,
                  //   child: 
                  //   //PinballLoadingIndicator(value: 0.5)
                  //   BlocBuilder<AssetsManagerCubit, AssetsManagerState>(
                  //     builder: (context, state) {
                  //       return PinballLoadingIndicator(value: state.progress);
                  //     },
                  //   ),
                  // ),
                ],
              ),
            )
            ));
  }
}
